<h1>Registrasi</h1>
<form action="<%=request.getContextPath()%>/register"  id="registrasi-form" method="POST">
    <table class="form">
        <tr><td><label>Nama Lengkap</label></td><td><input type="text" name="fullname" /></td></tr>
        <tr><td><label>Nama Panggilan</label></td><td><input type="text" name="shortname" /></td></tr>
        <tr><td><label>Email</label></td><td><input type="text" name="email" /></td></tr>
        <tr><td><label>Nomor Telepon</label></td><td><input type="text" name="telephone" /></td></tr>
        <tr><td><label>Alamat</label></td><td><input type="text" name="address" /></td></tr>
        <tr><td></td><td><input type="submit" value="Register" /></td></tr>
    </table>
</form>
<script>
    $(document).ready(function() {   
        $("#registrasi-form").validate({
            rules : {
                fullname : {
                    required : true,
                    minlength : 4
                },
                shortname : {
                    required : true
                },
                email : {
                    required : true,
                    email : true
                },
                telephone : {
                    required : true,
                    number : true,
                    minlength : 5
                },
                address : {
                    required : true
                }
            },
            messages : {
                fullname : {
                    required : "This field is required",
                    minlength : "Your name should be more than 4 character"
                },
                email : "Please enter a valid email address",
                telephone : {
                    required : "This field is required",
                    number : "This field must be in number format",
                    minlength : "Please enter a correct telephone number. Minimal length : 5 digit"
                }
             
            }
        });
    });
</script>
